//第一步 创建一个路由器  并暴露出去
import {createRouter, createWebHistory} from "vue-router";
import A from "@/components/routerDemovue/A.vue"
import B from "@/components/routerDemovue/B.vue"
import C from "@/components/routerDemovue/C.vue"
import News from "@/components/routerDemovue/News.vue"

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            name: "quA",
            path: "/a",
            component: A,
            children: [
                {
                    name:"shijian",
                    path: "news/:id/:title/:content",   //子集里是不用写/的
                    component: News,
                    props:true
                }
            ]
        },
        {
            name: "quB",
            path: "/b",
            component: B,
            children: [
                {
                    path: "news",   //子集里是不用写/的
                    component: News,
                    props(route) {
                        return route.query
                    },
                }
            ]
        },
        {
            name: "quC",
            path: "/c",
            component: C,
            children: [
                {
                    path: "news",   //子集里是不用写/的
                    component: News
                }
            ]
        },
    ]
})

export default router